<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:s="http://jboss.com/products/seam/taglib">
	
	<ui:remove>
		<!-- COMMENT
			Description: Only use this tag when dirty checking on this panel is required.
			
			Parameters:
				+ rModelPanelId:
			Optional:
				+ rModelPanelOnBeforeShown
				+ rModelPanelRichId
				+ rModelPanelDomElementAttachment
				
			WARNING: form in this panel must have id: "form_#{rModelPanelId}"
		 -->
	</ui:remove>
	
	<ui:remove><!-- COMMENT: set default value --></ui:remove>
	<c:if test="#{empty rModelPanelRichId}">
		<c:set var="rModelPanelRichId" value="#{rModelPanelId}_richModalPanel"/>
	</c:if>

	<ui:remove><!-- COMMENT: body of this component --></ui:remove>
	<s:div id="#{rModelPanelId}">
		<c:if test="#{modalPanelAction.isShowed(rModelPanelId)}">
			<c:if test="#{modalPanelAction.isNewMode(rModelPanelId)}">
				<s:div id="#{rModelPanelId}_#{constant.markerForNewForm}"/>
			</c:if>
		
		    <c:set var="rModelPanelFormId" value="form_#{rModelPanelId}"/>
			<rich:modalPanel id="#{rModelPanelRichId}" autosized="true"
				domElementAttachment="#{rModelPanelDomElementAttachment}"
				onbeforeshow="#{rModelPanelOnBeforeShown}">
				<ui:insert />
			</rich:modalPanel>
			<script type="text/javascript">
           		#{rich:component(rModelPanelRichId)}.show();
        	</script>
		</c:if>
	</s:div>
</ui:composition>
